class Solution {
public:
    int findKthLargest(vector<int>& nums, int k) {
        priority_queue<int,vector<int>,less<int>> heap;
        for(int i=0;i<nums.size();i++)
        {
            heap.push(nums[i]);
        }
        k--;
        while(k--)
        {
            heap.pop();
        }
        return heap.top();
    }
};